import { hlContextMenu } from './hlContextMenu';

/**
 * 表格配置
 * @param mode
 * @param cellComments
 * @param mergeCells
 * @param onContextMenuAction
 */
export const hlNormalConfig = (mode: 'editable' | 'write' | 'preview', cellComments: App.CellCommentItem[], mergeCells: App.MergeCellsItem[],
                               onContextMenuAction: (key: string, options: any) => void) => {
    return {
        licenseKey: 'non-commercial-and-evaluation',
        selectionMode: mode === 'editable' ? 'multiple' : 'none',
        disableVisualSelection: mode !== 'editable',
        width: '100%',
        stretchH: 'all',
        contextMenu: hlContextMenu(mode, onContextMenuAction),
        comments: true,
        undo: true,
        copyPaste: true,
        language: 'zh-CN',
        cell: cellComments,
        mergeCells: mergeCells,
    }
}
